package cn.turboinfo.dongying.api.provider.common.repository.database.user;

import net.sunshow.toolkit.core.qbean.helper.repository.BaseRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.Collection;
import java.util.List;
import java.util.Optional;

public interface SysUserDAO extends BaseRepository<SysUserPO, Long> {

    Optional<SysUserPO> findByUsername(String username);

    Optional<SysUserPO> findByMobile(String mobile);

    @Query(value = "select t from SysUserPO t where t.mobile like %?1% ")
    List<SysUserPO> findByMobileLike(String mobile);

    List<SysUserPO> findByIdInOrderByIdAsc(Collection<Long> idCollection);
}
